package com.yuanfeng.activity.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yuanfeng.activity.dto.CommonIsXianUpdateDTO;
import com.yuanfeng.activity.dto.FinishTimeSecondkillDTO;
import com.yuanfeng.activity.entity.ActivitySeckillBaseEntity;
import com.yuanfeng.activity.vo.GdbSeckillBaseVO;
import com.yuanfeng.commoms.dto.goods.ManageSeckillBaseUpdateDTO;
import com.yuanfeng.commoms.dto.goods.SeckillGoodsListDTO;
import com.yuanfeng.commoms.vo.activity.AppSeckillGoodsQueryResultVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @ClassName ActivitySeckillBaseMapper
 * @Description  限时秒杀活动表
 * @Author ty
 * @Date 2023-07-04 17:26:45
 * @Version 1.0
 **/
@Mapper
public interface ActivitySeckillBaseMapper extends BaseMapper<ActivitySeckillBaseEntity> {

    /**
     * 装修组件化 限时秒杀活动列表查询
     */
    IPage<Map<String,Object>> selectFinishTimeSecondkillPojo(IPage<Map<String,Object>> page, @Param("param") FinishTimeSecondkillDTO param);

    /**
     * 装修组件化 限时秒杀活动列表查询
     */
    IPage<Map<String,Object>> getByPage(IPage<Map<String,Object>> page, @Param("param") FinishTimeSecondkillDTO param);

    /**
     * 查询秒杀详情
     * @param seckillId
     * @return
     */
    Map<String, Object> querySecondKill(@Param("seckillId")Integer seckillId);

    IPage<ActivitySeckillBaseEntity> selectShopSeckillBaseList(IPage<ActivitySeckillBaseEntity> page , @Param("param") ManageSeckillBaseUpdateDTO param);


    IPage<AppSeckillGoodsQueryResultVO> selectBySeckillIdByPage(IPage<AppSeckillGoodsQueryResultVO> page , @Param("param") Map<String, Object> param);

    /**
     * 查询活动详情
     * @param seckillId
     * @return
     */
    GdbSeckillBaseVO selectByPrimaryKey(Integer seckillId);

    /**
     * 查询店铺名
     * @param shopId
     * @return
     */
    String selectShopName(@Param("shopId") Integer shopId);

    /**
     * 新增秒杀信息
     * @param param
     */
    void insertShopSeckillBase(@Param("param") ManageSeckillBaseUpdateDTO param);


    /**
     * 更新秒杀信息
     * @param param
     */
    void updateShopSeckillBase(@Param("param") ManageSeckillBaseUpdateDTO param);

    /***
     * 修改商品活动状态
     * @param param
     */
    void updateCommonIsXian3(@Param("param") CommonIsXianUpdateDTO param);

    /**
     * 查询秒杀活动信息
     * @param seckillId
     * @return
     */
    ManageSeckillBaseUpdateDTO selectSeckilById(@Param("seckillId")Integer seckillId);

    /**
     * 查询秒杀商品信息
     * @param seckillId
     * @return
     */
    List<SeckillGoodsListDTO> selectSeckilGoodsById(@Param("seckillId")Integer seckillId);
}
